Skip to content

Add DELETE support for cancelling blob uploads#2379

Draft
gerrod3 wants to merge 6 commits into
pulp:mainfrom
gerrod3:cursor/ba816279
Draft

Add DELETE support for cancelling blob uploads#2379
gerrod3 wants to merge 6 commits into
pulp:mainfrom
gerrod3:cursor/ba816279

Conversation

@gerrod3

@gerrod3 gerrod3 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implement DELETE /v2/<name>/blobs/uploads/<uuid> to cancel outstanding blob uploads
  • Return 204 No Content on success and 404 BLOB_UPLOAD_UNKNOWN when the upload does not exist
  • Add functional tests for cancel, unknown upload, and RBAC

Closes #482

Test plan

  • Run pytest pulp_container/tests/functional/api/test_cancel_blob_upload.py
  • Start a blob upload, cancel it with DELETE, and confirm the upload record is removed
  • DELETE a non-existent upload UUID and confirm BLOB_UPLOAD_UNKNOWN
  • Verify an unauthenticated/unauthorized user receives 401

Made with Cursor

@gerrod3

gerrod3 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Implement the Docker v2 blob upload cancel endpoint so clients can release
in-progress uploads instead of waiting for timeout.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3 gerrod3 force-pushed the cursor/ba816279 branch from a3f13cf to 32e2424 Compare July 1, 2026 14:58
Share the upload created in class setup for RBAC and success cases,
and align permission assertions with the delete manifest tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
gerrod3 and others added 4 commits July 1, 2026 11:16
Replace ORM assertions with GET upload status before and after DELETE.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The class-scoped setup fixture used the function-scoped local_registry
fixture, which pytest rejects with ScopeMismatch.

Co-authored-by: Cursor <cursoragent@cursor.com>
Create the repository and distribution once in class-scoped setup and
start blob uploads only in tests that need an outstanding upload.

Co-authored-by: Cursor <cursoragent@cursor.com>
container_repository_factory,
container_distribution_factory,
):
"""Create a push repository and distribution for all cancel blob upload tests."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the "push" repository terminology still accurate in this instance?

upload_uuid = _start_blob_upload(local_registry, full_path, self.repo_name)
delete_path = f"/v2/{full_path(self.repo_name)}/blobs/uploads/{upload_uuid}"
user_helpless = gen_user()
with user_helpless:

@dralley dralley Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure "helpless" is the best name for it. Maybe "user_no_permissions".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

As a user I can delete a blob upload via docker v2 api

2 participants